package com.tubi.MyCountDownLatch;

import java.util.concurrent.CountDownLatch;

public class ch2 extends Thread {
    private  CountDownLatch countDownLatch;
    public ch2(CountDownLatch countDownLatch) {
        this.countDownLatch =countDownLatch;
    }

    @Override
    public void run() {
        //1.吃饺子
        for (int i = 0; i < 15; i++) {
            System.out.println(getName() + "在吃" + i + "个饺子");
        }
        //2。出完说一下
        countDownLatch.countDown();
    }
}
